﻿using System.Collections.Generic;

//
// Created by Arosy on 2021/11/25.
//

//
// Created by Arosy on 2021/11/25.
//
// #ifndef JVM_CODEATTRIBUTEINFO_H
// #define JVM_CODEATTRIBUTEINFO_H

//extern class BytecodeStream;
public class CodeAttributeInfo
{
	private int attrNameIndex;
	private int attrLength;
	private int maxStack;
	private int maxLocals; //局部变量最大个数
	private BytecodeStream code;
	private int exceptionTableLength;
	private int codeLength;
	private int attributesCount; //局部变量表，操作数栈


	public SortedDictionary<string, AttributeInfo> attributes = new SortedDictionary<string, AttributeInfo>(); //附加属性


	//#endif //JVM_CODEATTRIBUTEINFO_H


//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: int getAttrNameIndex() const
	public int getAttrNameIndex()
	{
		return attrNameIndex;
	}

	public void setAttrNameIndex(int attrNameIndex)
	{
		this.attrNameIndex = attrNameIndex;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: int getAttrLength() const
	public int getAttrLength()
	{
		return attrLength;
	}

	public void setAttrLength(int attrLength)
	{
		this.attrLength = attrLength;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: int getMaxStack() const
	public int getMaxStack()
	{
		return maxStack;
	}

	public void setMaxStack(int maxStack)
	{
		this.maxStack = maxStack;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: int getMaxLocals() const
	public int getMaxLocals()
	{
		return maxLocals;
	}

	public void setMaxLocals(int maxLocals)
	{
		this.maxLocals = maxLocals;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: BytecodeStream *getCode() const
	public BytecodeStream getCode()
	{
		return code;
	}

	public void setCode(BytecodeStream code)
	{
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 TODO TASK: C# does not have an equivalent to pointers to variables (in C#, the variable no longer points to the original when the original variable is re-assigned):
//ORIGINAL LINE: CodeAttributeInfo::code = code;
		this.code = code;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: int getExceptionTableLength() const
	public int getExceptionTableLength()
	{
		return exceptionTableLength;
	}

	public void setExceptionTableLength(int exceptionTableLength)
	{
		this.exceptionTableLength = exceptionTableLength;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: int getCodeLength() const
	public int getCodeLength()
	{
		return codeLength;
	}

	public void setCodeLength(int codeLength)
	{
		this.codeLength = codeLength;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: int getAttributesCount() const
	public int getAttributesCount()
	{
		return attributesCount;
	}

	public void setAttributesCount(int attributesCount)
	{
		this.attributesCount = attributesCount;
	}

//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 WARNING: 'const' methods are not available in C#:
//ORIGINAL LINE: const ClassicMap<string, AttributeInfo *> &getAttributes() const
	public SortedDictionary<string, AttributeInfo > getAttributes()
	{
		return attributes;
	}

	public void setAttributes(SortedDictionary<string, AttributeInfo > attributes)
	{
		this.attributes = new SortedDictionary<string, AttributeInfo>(attributes);
	}
}
